﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Darwin.Source.Components.World.Entities
{
    class CShip : CEntity
    {
        public CShip()
        {
        }


        public override bool Initialise( Team.CTeam myTeam )
        {
            return base.Initialise(myTeam);
        }

        public override void DoRender()
        {
        #if DEBUG_GRAPHICS_ENABLED
            Vector3 testPoint = m_v3Position;
            Vector3 testNormal = Vector3.Zero;

            //
            //  Given a valid XZ value the terrain will return to you a height at that point, and the normal of the triangle you are on
            //
            testPoint.Y = Singleton<SunXNA.Terrain.CTerrain>.Instance.GetHeightAtXZ(testPoint, out testNormal);

            Singleton<SunXNA.DebugGraphics.CManager>.Instance.Add3DObject(9025,                             //you decide the UID, theres a very good reason for this...
                                                                          SunXNA.DebugGraphics.Type.Box,    //only boxes are available =]
                                                                          Color.Red,                       //any color you like
                                                                          testPoint,                        //send in a world position
                                                                          testNormal,                       //this is the direction it will face
                                                                          new Vector3( 0.1f, 0.1f, 5.0f ),  //this is scale, z scale is the scale along the direction... so this code will make it 5 tall... because its pointing up =]
                                                                          1.0f);                            //how long the graphic is alive for, < 0.0f will last FOREVAR!! ^__^
        #endif

        }

        public override void DoUpdate(GameTime gameTime, World w, List<PotentialFeild.CPotentialFeildVector> potentialFeildVectors, Vector4[] worldFeildData)
        {
        }
    }
}
